Skip to content

feat: Mounting PVC into Workspace within Subpath#1595

Merged
dkwon17 merged 3 commits intomainfrom
23683
Mar 6, 2026
Merged

feat: Mounting PVC into Workspace within Subpath#1595
dkwon17 merged 3 commits intomainfrom
23683

Conversation

@tolusha
Copy link
Contributor

@tolusha tolusha commented Feb 23, 2026

What does this PR do?

  • Introduces a new annotation controller.devfile.io/mount-sub-path that can be set on PVCs labeled for automounting (controller.devfile.io/mount-to-devworkspace: "true").
  • When this annotation is present, the PVC volume mount uses the specified subPath, mounting a subdirectory within the PVC instead of the root.

What issues does this PR fix or reference?

eclipse-che/che#23683

Is it tested? How?

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    controller.devfile.io/mount-path: '[{"path":"/test/logs","subPath":"data/logs"},{"path":"/test/config","subPath":"data/config"}]'
  labels:
    controller.devfile.io/mount-to-devworkspace: "true"
  name: devworkspace-subpath
  namespace: admin-che
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Feb 24, 2026
Copy link
Member

@rohanKanojia rohanKanojia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as expected!

oc get pod workspace4e61cbe77de44f3c-8686d5c5fc-lcg2g \                                             devfile/devworkspace-operator (pullRequest1595 ⚡) rohan-20y4s1qe0p
  -n openshift-operators \
  -o jsonpath='{.spec.containers[0].volumeMounts[?(@.name=="devworkspace-subpath")]}{"\n"}'        
{"mountPath":"/home/user/subpath","name":"devworkspace-subpath","subPath":"subpath"}

@dkwon17
Copy link
Collaborator

dkwon17 commented Mar 4, 2026

Thank you for the PR, could we extend it so that we can have multiple subpath mounts for a single PVC?

From eclipse-che/che#23683:

I need this feature because I'm trying to mount multiple folders into the workspace from a single-pvc.

Maybe something like:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    controller.devfile.io/mount-path: /home/user/subpath
    controller.devfile.io/mount-subpath: '["subpath1", "subpath3"]'

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Mar 5, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akurinnoy, dkwon17, rohanKanojia, tolusha

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Mar 6, 2026
@dkwon17 dkwon17 merged commit cce29e8 into main Mar 6, 2026
11 checks passed
@dkwon17 dkwon17 deleted the 23683 branch March 6, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants